import { getAction, putAction, postAction } from '@/api/manage'
import { serviceApi } from '@/api/common.js'
/**
 * 公共API接口
 */
export const api = {
  list: serviceApi.auth + '/positions',
  delete: (ids) => serviceApi.auth + `/positions/${ids}`
}

/**
 * 获取职务列表
 * @param {*} params
 * @returns
 */
export const getPositionList = params => getAction(api.list, params)

/**
 * 添加职务
 * @param {*} params
 * @returns
 */
export const addPosition = params => postAction(serviceApi.auth + '/positions', params)

/**
 * 编辑职务
 * @param {*} params
 * @returns
 */
export const editPosition = params => putAction(serviceApi.auth + '/positions', params)

/**
 * 通过租户Id获取
 * @param params
 * @returns {AxiosPromise}
 */
export const queryByTenantId = (tenantId, params) => getAction(serviceApi.auth + `/positions/tenants/${tenantId}`, params)
